home *** CD-ROM | disk | FTP | other *** search
/ Champak 49 / Volume 49 - JOGO DISK .iso / Games / happy_kids.swf / scripts / DefineSprite_126 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-09-27  |  1.2 KB  |  55 lines

  1. function walk()
  2. {
  3.    var _loc1_ = this;
  4.    var _loc2_ = _root;
  5.    _loc2_.sSound2.stop();
  6.    _loc2_.sSound1.start(0,1000);
  7.    _loc2_.comboNum = 0;
  8.    _loc2_.point = 0;
  9.    speed = 2;
  10.    gotoAndStop(2);
  11.    _loc1_.onEnterFrame = function()
  12.    {
  13.       var _loc1_ = this;
  14.       var _loc2_ = _root;
  15.       if(!(Math.abs(_loc2_._ymouse - (_Y - 32)) < 3 && Math.abs(_loc2_._xmouse - _X) < 3))
  16.       {
  17.          _loc1_.swapDepths(_loc1_._y * 100 + id);
  18.          radian = Math.atan2(_loc2_._ymouse - (_Y - 32),_loc2_._xmouse - _X);
  19.          _loc1_._x += speed * Math.cos(radian);
  20.          _loc1_._y += speed * Math.sin(radian);
  21.          if(_loc1_._y < 110)
  22.          {
  23.             _loc1_._y = 110;
  24.          }
  25.       }
  26.    };
  27.    _loc1_.onMouseDown = function()
  28.    {
  29.       if(_root.comboNum >= 5)
  30.       {
  31.          this.oyaji();
  32.       }
  33.    };
  34. }
  35. function oyaji()
  36. {
  37.    var _loc1_ = this;
  38.    _root.sSound1.stop();
  39.    _loc1_.gotoAndStop(3);
  40.    timeOut = 5000;
  41.    startTime = getTimer();
  42.    _loc1_.onEnterFrame = function()
  43.    {
  44.       if(getTimer() > startTime + timeOut)
  45.       {
  46.          this.p.rev();
  47.          delete this.onEnterFrame;
  48.       }
  49.    };
  50.    delete _loc1_.onMouseDown;
  51. }
  52. id = 1;
  53. this.swapDepths(this._y * 100 + id);
  54. stop();
  55.